package com.fc.mall.controller;

import com.fc.mall.dto.CommonResult;
import com.fc.mall.dto.OmsBargainParam;
import com.fc.mall.service.OmsBargainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by sunny on 2019/9/25.
 */
@Api("会员发起砍价API")
@RestController
@RequestMapping("/oms/bargain")
public class OmsBargainController {

    @Autowired
    private OmsBargainService bargainService;

    @ApiOperation("获取会员发起砍价列表")
    @GetMapping("list")
    public CommonResult handleGetBargainList(OmsBargainParam bargainParam,
                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum)
    {

        return new CommonResult().pageSuccess(bargainService.getList(bargainParam,  pageNum, pageSize));
    }
}
